package com.wuchu.shiro.service.impl;

import com.wuchu.shiro.mapper.UserMapper;
import com.wuchu.shiro.pojo.User;
import com.wuchu.shiro.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类描述：
 * Author: WuChu
 * Date: 2022/3/4
 * Version: 1.0
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;

    @Override
    public User queryByName(String username) {
        User user = userMapper.queryByName(username);
        return user;
    }

    @Override
    public void add(User user) {
        userMapper.add(user);
    }

    @Override
    public List<User> queryAll() {
        return userMapper.queryAll();
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void delete(int id) {
        userMapper.delete(id);
    }

    @Override
    public User queryById(int id) {
        return userMapper.queryById(id);
    }
}
